<!-- 设备管理-基础设置页面 -->
<template>
  <px-tabs :modelValue="activeName" class="equipment-tabs" @tab-click="handleTabClick">
    <px-tab-pane v-for="(item, index) in tabList" :key="`${timer ? `${timer}${index}` : index}`" :name="item?.name">
      <template #label>
        <p class="pane-bottom">{{ item?.label }}</p>
        <p class="pane-line" />
      </template>
    </px-tab-pane>
  </px-tabs>
</template>
<script lang="ts" setup>
defineOptions({
  name: "CommonEquipSetting"
});
const props = defineProps({
  activeName: {
    type: [String, Number],
    default: ""
  },
  tabList: {
    type: Array,
    deep: true,
    required: true,
    default: () => []
  },
  timer: {
    required: false
  }
});
const emit = defineEmits(["tabSelect", "update:activeName"]);
const handleTabClick = (tab, event) => {
  emit("tabSelect", tab.paneName);
};
</script>

<style lang="scss" scoped>
:deep(.px-tabs__nav) {
  z-index: 0;
}
</style>
